<?php
    echo doctype();
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>
            <?php
                echo $this->lang->line('agent_title_widget');
            ?>
        </title>
        <?php
            echo link_tag('css/agent_widget.css');
        ?>
        <script type="text/javascript" src="<?php echo base_url() . 'js/jquery-1.4.4.min.js';?>"></script>
        <script type="text/javascript" src="<?php echo base_url() . 'js/jquery.pack.js';?>"></script>
        <script type="text/javascript" src="<?php echo base_url() . 'js/common_js.js';?>"></script>
        <script type="text/javascript" src="<?php echo base_url() . 'js/agent_widget.js';?>"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                base_url = '<?php echo base_url(); ?>';
                agent_widget();
                setInterval(get_waiting, 1000);
                setInterval(get_stats, 2000);
                $("#logout").click(
                    function() {
                        $.post(base_url + 'ajax/logout_widget/');
                        window.opener.location.href = base_url + 'login/';
                        window.close();
                    }
                );
            });
        </script>
    </head>
    <body>
        <div id="container">
            <div id="head_box">
                <div id="logo">
                </div>
                <div id="log_out">
                    <?php
                        echo anchor('logout/', 'Log-out', array('id' => 'logout'));
                    ?>
                </div>
                <div id="company_name">
                    <h1>
                        <?php
                            echo $settings['company_name'];
                        ?>
                    </h1>
                </div>
            </div>
            <div id="agent_name">
                <?php
                    echo $settings['last_name'] . ', ' . $settings['first_name'];
                ?>
            </div>
            <div id="customer_box_waiting">
                <div class="customer_info">
                    <div id="waiting1"></div>
                    <div id="waiting2"></div>
                </div>
                <div id="waiting3">
                    <?php
                        echo img(base_url() . 'images/loader_r.gif');
                    ?>
                </div>
            </div>
            <div id="customer_box">
                <div class="customer_info">
                    <div id="service_type"></div>
                    <div id="queue_number"></div>
                </div>
                <div id="customer_form">
                    <input class="cust_text" type="text" maxlength="20" id="mobile_number"/>
                    <div class="button_box">
                        <div class="button_holder">
                            <div  class="cust_button">
                                <button type="submit" name="submit" id="enter">
                                    <div class="fix_button">
                                        <?php
                                            echo img('images/accept.png');
                                        ?>
                                        <div class="fix_button_text">
                                            <?php
                                                echo $this->lang->line('agent_enter');
                                            ?>
                                        </div>
                                    </div>
                                </button>
                            </div>
                            <div class="cust_button">
                                <button type="submit" name="skip" id="skip">
                                    <div class="fix_button">
                                        <?php
                                            echo img('images/arrow_right.png');
                                        ?>
                                        <div class="fix_button_text">
                                            <?php
                                                echo $this->lang->line('agent_skip');
                                            ?>
                                        </div>
                                    </div>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="customer_form_finish">
                    <input type="hidden" class="id" name="id" />
                    <select id="closing_code"></select>
                    <div class="button_box">
                        <div class="button_holder">
                            <div  class="cust_button">
                                <button name="finish" type="submit">
                                    <div class="fix_button">
                                        <?php
                                            echo img('images/accept.png');
                                        ?>
                                        <div class="img_text_spc"></div>
                                        <div class="fix_button_text">
                                            <?php
                                                echo $this->lang->line('agent_finished');
                                            ?>
                                        </div>
                                    </div>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="notice"></div>
            <div id="stat_container">
                <div class="stat_btn">
                    <div class="stat_label">
                        <?php
                            echo $this->lang->line('agent_queue_size');
                        ?>
                    </div>
                    <div class="stat_info" id="waiting_stat">
                        <?php
                            echo img(base_url() . 'images/loader.gif');
                        ?>
                    </div>
                    <div class="stat_link">
                        <?php
                            $atts = array(
                                'width'      => '945',
                                'height'     => '500',
                                'scrollbars' => 'no',
                                'status'     => 'no',
                                'resizable'  => 'yes',
                                'screenx'    => '0',
                                'screeny'    => '0'
                            );
                            echo anchor_popup('agent/logs_grid/waiting', 'VIEW LIST', $atts);
                        ?>
                    </div>
                </div>
                <div class="stat_vert_separator"></div>
                <div class="stat_btn">
                    <div class="stat_label">
                        <?php
                            echo $this->lang->line('agent_served');
                        ?>
                    </div>
                    <div class="stat_info" id="served_stat">
                        <?php
                            echo img(base_url() . 'images/loader.gif');
                        ?>
                    </div>
                    <div class="stat_link">
                        <?php
                            echo anchor_popup('agent/logs_grid/served', 'VIEW LIST', $atts);
                        ?>
                    </div>
                </div>
                <div class="stat_vert_separator"></div>
                <div class="stat_btn">
                    <div class="stat_label">
                        <?php
                            echo $this->lang->line('agent_missed');
                        ?>
                    </div>
                    <div class="stat_info" id="missed_stat">
                        <?php
                            echo img(base_url() . 'images/loader.gif');
                        ?>
                    </div>
                    <div class="stat_link">
                        <?php
                            echo anchor_popup('agent/logs_grid/missed', 'VIEW LIST', $atts);
                        ?>
                    </div>
                </div>
                <div id="stat_note">
                </div>
            </div>
        </div>
    </body>
</html>